package uk.co.accolade.clash.core;

public class Username {

    private String username;

    public static Username systemUsername() {
        return new Username( System.getProperty("user.name") );
    }

    public Username( String username ) {
        this.username = username;
    }

    public String getUsername() {
        return username;
    }

    @Override
    public int hashCode() {
        return username.hashCode();
    }

    @Override
    public boolean equals( Object o ) {
        if( !(o instanceof Username) ) return false;
        Username otherUsername = (Username)o;
        return username.equals( otherUsername.getUsername() );
    }

    @Override
    public String toString() {
        return username;
    }
}
